

import java.math.BigInteger;

public class Main{

	public static BigInteger[] factorials = new BigInteger[101];

	public static void main(String[] args) throws java.lang.Exception {
		factorials[0] = new BigInteger("1");
		factorials[1] = new BigInteger("1");
		for (int i = 2; i < factorials.length; i++) {
			factorials[i] = factorials[i - 1].multiply(new BigInteger("" + i));
		}
		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));
		int number = Integer.parseInt(r.readLine());

		for (int i = 0; i < number; i++) {
			String s = r.readLine().trim();
			System.out.println(factorials[Integer.parseInt(s)].toString());
		}
	}
}
